package jvm.heap;

public class HeapSpaceInitial {

    public static void main(String[] args) {
        long initialMemory = Runtime.getRuntime().totalMemory() / 1024 / 1024;
        long maxMemory = Runtime.getRuntime().maxMemory() / 1024 / 1024;

        System.out.println("-Xms:"+initialMemory+"M");
        System.out.println("-Xmx:"+maxMemory+"M");

        System.out.println("系统内存大小为："+initialMemory*64/1024+"G");
        System.out.println("系统内存大小为："+maxMemory*4/1024+"G");

        try {
            Thread.sleep(1000000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
